﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Category.aspx.cs" Inherits="Directory.Web.Admin_Category"
    Theme="Admin_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <script type="text/javascript">
        function NavUrl(url) {
            location.href = url;
        }
        function Go2Category(id, reloadall) {
            top.RefreshNodeTree(id);
            location.href = "CategoryView.aspx?categoryId=" + id;
            if (reloadall) {
                parent.location.href = "categorydetails.aspx?categoryId=" + id;
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div class="container">
        <div class="pageheader">
            <asp:Literal ID="ltTittle" runat="server"></asp:Literal>
        </div>
        <asp:Panel ID="pnlSingle" runat="server" Visible="false">
            <table>
                <tr>
                    <td>
                        <label>
                            <% =Resources.Resource.ResourceManager.GetString("CategoryName") %></label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbName" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label>
                            <% =Resources.Resource.ResourceManager.GetString("ParentCategory") %></label>
                    </td>
                    <td>
                        <DirectoryControl:CascadingCategory ID="CascadingCategory" runat="server" />
                    </td>
                </tr>
                <tr style="display: none;">
                    <td>
                        <label>
                            <% =Resources.Resource.ResourceManager.GetString("CategoryDescription") %></label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbDescription" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr style="display: none;">
                    <td>
                        <label>
                            <% =Resources.Resource.ResourceManager.GetString("CategoryMarker") %></label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbMarker" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label>
                            <% =Resources.Resource.ResourceManager.GetString("CategoryOrder") %></label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbOrder" runat="server" Text="-1"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbOrder"
                            ErrorMessage="*"></asp:RequiredFieldValidator>
                        【从1开始，非正数时自动添加到最后】
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="tbOrder"
                            ValidationExpression="^-?\d*$"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <center>
                            <asp:Panel ID="pnlSingleAdd" runat="server" Visible="false">
                                <asp:Button ID="btnAdd" runat="server" Text="添　加" OnClick="btnAdd_Click" />
                                &nbsp; &nbsp;
                                <input type="button" onclick="NavUrl('CategoryView.aspx?<%= categoryIdKey %>=<%= categoryId %>')"
                                    value="取　消" class="input_Button" />
                            </asp:Panel>
                            <asp:Panel ID="pnlRootAdd" runat="server" Visible="false">
                                <asp:Button ID="btnRootAdd" runat="server" Text="添　加" OnClick="btnAdd_Click" />
                                &nbsp; &nbsp;
                                <input type="button" onclick="NavUrl('category.aspx?action=addrootcategory')" value="重 置"
                                    class="input_Button" />
                            </asp:Panel>
                            <asp:Panel ID="pnlModify" runat="server" Visible="false">
                                <asp:Button ID="btnSave" runat="server" Text="保存修改" OnClick="btnSave_Click" />
                                &nbsp; &nbsp;
                                <asp:Button ID="btnDelete" runat="server" Text="删除目录" OnClick="btnDelete_Click" />
                                &nbsp; &nbsp;
                                <input type="button" class="input_Button" value="返　回" onclick="NavUrl('CategoryView.aspx?<%= categoryIdKey %>=<%= categoryId %>')" />
                            </asp:Panel>
                            <asp:Literal ID="ltMsg" runat="server"></asp:Literal>
                        </center>
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <asp:Panel ID="pnlBatch" runat="server" Visible="false" Height="300">
            <table>
                <colgroup>
                    <col width="30%" />
                    <col width="70%" />
                </colgroup>
                <tr>
                    <td>
                        <span class="FL">所属<% = Resources.Resource.ResourceManager.GetString("Category") %>：</span>
                    </td>
                    <td>
                        <DirectoryControl:CascadingCategory ID="CascadingCategory_batch" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <% = Resources.Resource.ResourceManager.GetString("CategoryName")%>
                    </td>
                    <td>
                        <asp:TextBox ID="tbNameBat" runat="server" TextMode="MultiLine" Width="100%" Rows="10"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <center>
                            <asp:Button ID="btnBatchAdd" runat="server" Text="添　加" OnClick="btnBatchAdd_Click" />
                            <input type="button" onclick="NavUrl('CategoryView.aspx?<%= categoryIdKey %>=<%= categoryId %>')"
                                value="取　消" class="input_Button" />
                        </center>
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
    </form>
</body>
</html>
